package server

import (
	"context"
	pb "wire/api/user"
	"wire/internal/service"
)

type UserGRPCServer struct {
	pb.UnimplementedUserServer
	us *service.UserService
}

func NewUserGRPCServer(us *service.UserService) *UserGRPCServer {
	return &UserGRPCServer{us: us}
}

// Get
func (s *UserGRPCServer) Get(ctx context.Context, req *pb.GetRequest) (*pb.UserInfo, error) {
	return s.us.Get(ctx, req)
}

// List
func (s *UserGRPCServer) List(ctx context.Context, req *pb.ListRequest) (*pb.ListReply, error) {
	return s.us.List(ctx, req)
}
